package com.hlk.emos.wx.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.hlk.emos.wx.config.shiro.JwtConfig;
import com.hlk.emos.wx.config.shiro.ThreadLocalToken;
import com.hlk.emos.wx.db.dao.CityDao;
import com.hlk.emos.wx.db.pojo.CityEntity;
import com.hlk.emos.wx.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

@RestController
@RequestMapping("/test")
@Api(tags = "测试Web接口")
public class TestController {
    @Autowired
    private JwtConfig jwtConfig;
    @Autowired
    private CityDao cityDao;
    @Autowired
    private ThreadLocalToken threadLocalToken;

    @PostMapping("/sayHello")
    @ApiOperation("最简单的测试方法")
    public Result sayHello() {
        threadLocalToken.setToken("token");
        return new Result().ok(jwtConfig.getSecret());
    }


    @PostMapping("/add")
    @ApiOperation("测试添加")
    public Result add() {
        return new Result().ok(jwtConfig.getCacheExpire());
    }


}
